'use strict'
  class OrderService {
    constructor(rpc_client) {
      this.rpc_client = rpc_client
    }
    /**
    * 获取订单配送轨迹
    * @params orderId 订单Id
    * @return
    */
    getDeliveryRoutes(orderId) {
      return this.rpc_client.request("eleme.order.delivery.getDeliveryRoutes", {
        orderId: orderId,
      })
    }
    /**
    * 获取订单
    * @params orderId 订单Id
    * @return
    */
    getOrder(orderId) {
      return this.rpc_client.request("eleme.order.getOrder", {
        orderId: orderId,
      })
    }
    /**
    * 批量获取订单
    * @params orderIds 订单Id的列表
    * @return
    */
    mgetOrders(orderIds) {
      return this.rpc_client.request("eleme.order.mgetOrders", {
        orderIds: orderIds,
      })
    }
    /**
    * 确认订单(推荐)
    * @params orderId 订单Id
    * @return
    */
    confirmOrderLite(orderId) {
      return this.rpc_client.request("eleme.order.confirmOrderLite", {
        orderId: orderId,
      })
    }
    /**
    * 取消订单(推荐)
    * @params orderId 订单Id
    * @params type 取消原因
    * @params remark 备注说明
    * @return
    */
    cancelOrderLite(orderId, type, remark) {
      return this.rpc_client.request("eleme.order.cancelOrderLite", {
        orderId: orderId,
        type: type,
        remark: remark,
      })
    }
    /**
    * 同意退单/同意取消单(推荐)
    * @params orderId 订单Id
    * @return
    */
    agreeRefundLite(orderId) {
      return this.rpc_client.request("eleme.order.agreeRefundLite", {
        orderId: orderId,
      })
    }
    /**
    * 不同意退单/不同意取消单(推荐)
    * @params orderId 订单Id
    * @params reason 商家不同意退单原因
    * @return
    */
    disagreeRefundLite(orderId, reason) {
      return this.rpc_client.request("eleme.order.disagreeRefundLite", {
        orderId: orderId,
        reason: reason,
      })
    }
    /**
    * 获取订单配送记录
    * @params orderId 订单Id
    * @return
    */
    getDeliveryStateRecord(orderId) {
      return this.rpc_client.request("eleme.order.getDeliveryStateRecord", {
        orderId: orderId,
      })
    }
    /**
    * 批量获取订单最新配送记录
    * @params orderIds 订单Id列表
    * @return
    */
    batchGetDeliveryStates(orderIds) {
      return this.rpc_client.request("eleme.order.batchGetDeliveryStates", {
        orderIds: orderIds,
      })
    }
    /**
    * 配送异常或者物流拒单后选择自行配送(推荐)
    * @params orderId 订单Id
    * @return
    */
    deliveryBySelfLite(orderId) {
      return this.rpc_client.request("eleme.order.deliveryBySelfLite", {
        orderId: orderId,
      })
    }
    /**
    * 配送异常或者物流拒单后选择不再配送(推荐)
    * @params orderId 订单Id
    * @return
    */
    noMoreDeliveryLite(orderId) {
      return this.rpc_client.request("eleme.order.noMoreDeliveryLite", {
        orderId: orderId,
      })
    }
    /**
    * 订单确认送达
    * @params orderId 订单Id
    * @return
    */
    receivedOrderLite(orderId) {
      return this.rpc_client.request("eleme.order.receivedOrderLite", {
        orderId: orderId,
      })
    }
    /**
    * 订单确认送出(自配送)
    * @params orderId 订单Id
    * @params phone 配送者电话
    * @return
    */
    startDeliveryBySelf(orderId, phone) {
      return this.rpc_client.request("eleme.order.startDeliveryBySelf", {
        orderId: orderId,
        phone: phone,
      })
    }
    /**
    * 订单确认送达(自配送)
    * @params orderId 订单Id
    * @params phone 配送者电话
    * @return
    */
    completeDeliveryBySelf(orderId, phone) {
      return this.rpc_client.request("eleme.order.completeDeliveryBySelf", {
        orderId: orderId,
        phone: phone,
      })
    }
    /**
    * 回复催单
    * @params remindId 催单Id
    * @params type 回复类别
    * @params content 回复内容,如果type为custom,content必填,回复内容不能超过30个字符
    * @return
    */
    replyReminder(remindId, type, content) {
      return this.rpc_client.request("eleme.order.replyReminder", {
        remindId: remindId,
        type: type,
        content: content,
      })
    }
    /**
    * 获取指定订单菜品活动价格.
    * @params orderId 订单Id
    * @return
    */
    getCommodities(orderId) {
      return this.rpc_client.request("eleme.order.getCommodities", {
        orderId: orderId,
      })
    }
    /**
    * 批量获取订单菜品活动价格
    * @params orderIds 订单Id列表
    * @return
    */
    mgetCommodities(orderIds) {
      return this.rpc_client.request("eleme.order.mgetCommodities", {
        orderIds: orderIds,
      })
    }
    /**
    * 获取订单退款信息
    * @params orderId 订单Id
    * @return
    */
    getRefundOrder(orderId) {
      return this.rpc_client.request("eleme.order.getRefundOrder", {
        orderId: orderId,
      })
    }
    /**
    * 批量获取订单退款信息
    * @params orderIds 订单Id列表
    * @return
    */
    mgetRefundOrders(orderIds) {
      return this.rpc_client.request("eleme.order.mgetRefundOrders", {
        orderIds: orderIds,
      })
    }
    /**
    * 取消呼叫配送
    * @params orderId 订单Id
    * @return
    */
    cancelDelivery(orderId) {
      return this.rpc_client.request("eleme.order.cancelDelivery", {
        orderId: orderId,
      })
    }
    /**
    * 呼叫配送
    * @params orderId 订单Id
    * @params fee 小费,1-8之间的整数
    * @return
    */
    callDelivery(orderId, fee) {
      return this.rpc_client.request("eleme.order.callDelivery", {
        orderId: orderId,
        fee: fee,
      })
    }
    /**
    * 获取店铺未回复的催单
    * @params shopId 店铺Id
    * @return
    */
    getUnreplyReminders(shopId) {
      return this.rpc_client.request("eleme.order.getUnreplyReminders", {
        shopId: shopId,
      })
    }
    /**
    * 查询店铺未处理订单
    * @params shopId 店铺Id
    * @return
    */
    getUnprocessOrders(shopId) {
      return this.rpc_client.request("eleme.order.getUnprocessOrders", {
        shopId: shopId,
      })
    }
    /**
    * 查询店铺未处理的取消单
    * @params shopId 店铺Id
    * @return
    */
    getCancelOrders(shopId) {
      return this.rpc_client.request("eleme.order.getCancelOrders", {
        shopId: shopId,
      })
    }
    /**
    * 查询店铺未处理的退单
    * @params shopId 店铺Id
    * @return
    */
    getRefundOrders(shopId) {
      return this.rpc_client.request("eleme.order.getRefundOrders", {
        shopId: shopId,
      })
    }
    /**
    * 查询全部订单
    * @params shopId 店铺Id
    * @params pageNo 页码。取值范围:大于零的整数最大限制为100
    * @params pageSize 每页获取条数。最小值1，最大值50。
    * @params date 日期,默认当天,格式:yyyy-MM-dd
    * @return
    */
    getAllOrders(shopId, pageNo, pageSize, date) {
      return this.rpc_client.request("eleme.order.getAllOrders", {
        shopId: shopId,
        pageNo: pageNo,
        pageSize: pageSize,
        date: date,
      })
    }
    /**
    * 批量查询订单是否支持索赔
    * @params orderIds 索赔订单Id的列表
    * @return
    */
    querySupportedCompensationOrders(orderIds) {
      return this.rpc_client.request("eleme.order.querySupportedCompensationOrders", {
        orderIds: orderIds,
      })
    }
    /**
    * 批量申请索赔
    * @params requests 索赔请求的列表
    * @return
    */
    batchApplyCompensations(requests) {
      return this.rpc_client.request("eleme.order.batchApplyCompensations", {
        requests: requests,
      })
    }
    /**
    * 批量查询索赔结果
    * @params orderIds 索赔订单Id的列表
    * @return
    */
    queryCompensationOrders(orderIds) {
      return this.rpc_client.request("eleme.order.queryCompensationOrders", {
        orderIds: orderIds,
      })
    }
    /**
    * 众包订单询价，获取配送费
    * @params orderId 订单Id
    * @return
    */
    getDeliveryFeeForCrowd(orderId) {
      return this.rpc_client.request("eleme.order.getDeliveryFeeForCrowd", {
        orderId: orderId,
      })
    }
    /**
    * 评价骑手
    * @params orderId 订单Id
    * @params evaluationInfo 评价信息
    * @return
    */
    evaluateRider(orderId, evaluationInfo) {
      return this.rpc_client.request("eleme.order.evaluateRider", {
        orderId: orderId,
        evaluationInfo: evaluationInfo,
      })
    }
    /**
    * 批量获取骑手评价信息
    * @params orderIds 订单Id的列表
    * @return
    */
    mgetEvaluationInfos(orderIds) {
      return this.rpc_client.request("eleme.order.mgetEvaluationInfos", {
        orderIds: orderIds,
      })
    }
    /**
    * 批量获取是否可以评价骑手
    * @params orderIds 订单Id的列表
    * @return
    */
    mgetEvaluationStatus(orderIds) {
      return this.rpc_client.request("eleme.order.mgetEvaluationStatus", {
        orderIds: orderIds,
      })
    }
    /**
    * 批量获取订单加小费信息
    * @params orderIds 订单Id的列表
    * @return
    */
    mgetDeliveryTipInfos(orderIds) {
      return this.rpc_client.request("eleme.order.mgetDeliveryTipInfos", {
        orderIds: orderIds,
      })
    }
    /**
    * 订单加小费
    * @params orderId 订单Id
    * @params tip 小费金额
    * @return
    */
    addDeliveryTipByOrderId(orderId, tip) {
      return this.rpc_client.request("eleme.order.addDeliveryTipByOrderId", {
        orderId: orderId,
        tip: tip,
      })
    }
    /**
    * 主动发起退单
    * @params orderId 订单Id
    * @params type 取消原因
    * @params remark 备注说明
    * @return
    */
    applyRefund(orderId, type, remark) {
      return this.rpc_client.request("eleme.order.applyRefund", {
        orderId: orderId,
        type: type,
        remark: remark,
      })
    }
    /**
    * 非自配送餐厅标记已出餐
    * @params orderId 订单Id
    * @return
    */
    setOrderPrepared(orderId) {
      return this.rpc_client.request("eleme.order.setOrderPrepared", {
        orderId: orderId,
      })
    }
    /**
    * 查询已出餐列表
    * @params orderIds 查询已出餐订单Id的列表
    * @return
    */
    getPreparedTimesByOrderIds(orderIds) {
      return this.rpc_client.request("eleme.order.getPreparedTimesByOrderIds", {
        orderIds: orderIds,
      })
    }
    /**
    * 查询顾客联系方式
    * @params orderIds 订单Id的列表
    * @return
    */
    mgetUserSimpleInfoByOrderIds(orderIds) {
      return this.rpc_client.request("eleme.order.mgetUserSimpleInfoByOrderIds", {
        orderIds: orderIds,
      })
    }
    /**
    * 商家部分退款
    * @params orderId 订单Id
    * @params refundOrderMessage 退款详情
    * @return
    */
    refundPart(orderId, refundOrderMessage) {
      return this.rpc_client.request("eleme.order.refundPart", {
        orderId: orderId,
        refundOrderMessage: refundOrderMessage,
      })
    }
    /**
    * 设置订单开票地址
    * @params orderId 订单Id
    * @params invoiceUrl 开票地址
    * @return
    */
    setInvoiceUrl(orderId, invoiceUrl) {
      return this.rpc_client.request("eleme.order.setInvoiceUrl", {
        orderId: orderId,
        invoiceUrl: invoiceUrl,
      })
    }
    /**
    * 自配送商家同步运单的状态信息
    * @params shopId 店铺Id
    * @params stateInfo 运单状态信息
    * @return
    */
    selfDeliveryStateSync(shopId, stateInfo) {
      return this.rpc_client.request("eleme.order.selfDeliveryStateSync", {
        shopId: shopId,
        stateInfo: stateInfo,
      })
    }
    /**
    * 自配送商家同步运单的位置信息
    * @params shopId 店铺Id
    * @params orderId 订单Id
    * @params locationInfo 位置信息,仅接受火星坐标系
    * @return
    */
    selfDeliveryLocationSync(shopId, orderId, locationInfo) {
      return this.rpc_client.request("eleme.order.selfDeliveryLocationSync", {
        shopId: shopId,
        orderId: orderId,
        locationInfo: locationInfo,
      })
    }
    /**
    * 订单预计出餐时间
    * @params orderId 订单Id
    * @params predictTime 预计订单出餐时间
    * @return
    */
    orderPredictFinishTime(orderId, predictTime) {
      return this.rpc_client.request("eleme.order.orderPredictFinishTime", {
        orderId: orderId,
        predictTime: predictTime,
      })
    }
    /**
    * 菜品预计出餐时间
    * @params shopId 店铺Id
    * @params commodityInfo 菜品信息
    * @return
    */
    commodityPredictFinishTime(shopId, commodityInfo) {
      return this.rpc_client.request("eleme.order.commodityPredictFinishTime", {
        shopId: shopId,
        commodityInfo: commodityInfo,
      })
    }
    /**
    * 菜品实际出餐时间
    * @params shopId 店铺Id
    * @params commodityInfo 菜品信息
    * @return
    */
    commodityActualFinishTime(shopId, commodityInfo) {
      return this.rpc_client.request("eleme.order.commodityActualFinishTime", {
        shopId: shopId,
        commodityInfo: commodityInfo,
      })
    }
    /**
    * 匿名订单查询可用虚拟小号
    * @params orderId 订单Id
    * @return
    */
    queryCallAvailable(orderId) {
      return this.rpc_client.request("eleme.order.queryCallAvailable", {
        orderId: orderId,
      })
    }
}

module.exports = OrderService